import request from "../utils/request";

export function getCaptcha(params) {
    return request({
        url: '/captcha/image',
        method: 'get',
        responseType: 'arraybuffer',
        params
    })
}
export function loginByJson(data) {
    return request({
        url: '/u/loginByJson',
        method: 'post',
        data
    })
}
//获取个人信息
export function getInfo() {
    return request({
        url: '/personal/getInfo'
    })
}
//获取路由
export function getRouters(rolePerm) {
    return request({
        url: `/personal/getRouters/${rolePerm}`
    })
}
//发送短信
export function sendMessage(data) {
    return request({
        url: '/captcha/sendRegisterOrLoginCaptcha',
        params: data
    })
}

//手机验证码登录
export function loginByMobile(data) {
    return request({
        url: '/u/loginByMobile',
        method: 'post',
        data
    })
}